PROJECT (Crawler)

SET (CMAKE_C_FLAGS_DEBUGSTATIC            "${CMAKE_C_FLAGS_DEBUG} -static -Wall -g D_REENTRANT")
SET (CMAKE_CXX_FLAGS_DEBUGSTATIC          "${CMAKE_C_FLAGS_DEBUG} -static -Wall -g D_REENTRANT")
SET (CMAKE_C_FLAGS_RELEASESTATIC          "${CMAKE_C_FLAGS_RELEASE} -static -Wall")
SET (CMAKE_CXX_FLAGS_RELEASESTATIC        "${CMAKE_CXX_FLAGS_RELEASE} -static -Wall")
SET (CMAKE_C_FLAGS_RELWITHDEBINFOSTATIC   "${CMAKE_C_FLAGS_RELWITHDEBINFO} -static -Wall")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFOSTATIC "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -static -Wall")

#SET (CMAKE_INSTALL_PREFIX "./") 

# Generic Settings
SET (CMAKE_BUILD_TYPE Debug)

# header files, same as "-I"
INCLUDE_DIRECTORIES (../util/include/)
INCLUDE_DIRECTORIES (../third-party/include/)

# Link files, same as "-L"
LINK_DIRECTORIES (../util/lib/)
LINK_DIRECTORIES (../third-party/lib/)

# Demo
ADD_EXECUTABLE (Url_t Url_t.cpp Url.cpp)
ADD_EXECUTABLE (MultiDnsResolver_t MultiDnsResolver_t.cpp MultiDnsResolver.cpp)

ADD_EXECUTABLE (Crawl_t Crawl_t.cpp Crawl.cpp Http.cpp Url.cpp Page.cpp TianwangFile.cpp)

# Final 
SET(CRAWLER Url.cpp)

# Sources
# AUX_SOURCE_DIRECTORY (src/ ANA)

# to generate lib
# ADD_LIBRARY (builddict ${ANA})

# to generate executable
# ADD_EXECUTABLE (test/tanalysis test/main.cpp)
# example: ADD_EXECUTABLE(my_test ../searchable/src/TWWebPage.cpp ./my_test.cpp)

# lib which is used
# add used lib here, such as "boost_unit_test_framework" for unit test
# 注意：可以为每一个target设定不同的lib，以及debug和release模式等，参阅手册
TARGET_LINK_LIBRARIES(MultiDnsResolver_t pthread)
TARGET_LINK_LIBRARIES(Crawl_t pthread z)

# INSTALL(TARGETS # add here
#   RUNTIME DESTINATION bin
#   LIBRARY DESTINATION lib
#   ARCHIVE DESTINATION lib)